package com.bl.student.dao.model;

import com.bl.student.dao.model.converter.DatetimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by yujingyi on 2018/2/1.
 */
@Entity
@Data
@Table(name = "VOTE")
@ApiModel(value = "VoteEntity", description = "投票")
@DynamicInsert
@DynamicUpdate
public class VoteEntity {

    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "数量")
    private int amount;

    @ApiModelProperty(value = "顺序")
    @Column(name = "display_order")
    private Integer displayOrder;

    @ApiModelProperty(value = "主体ID")
    @Column(name = "subject_id")
    private String subjectId;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    @Convert(converter = DatetimeConverter.class)
    private Long createTime;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "update_time")
    @Convert(converter = DatetimeConverter.class)
    private Long updateTime;
}
